//
//  TemplateUtils.m
//  PrintExtApiDemo
//
//  Created by wewin on 2019/3/9.
//  Copyright © 2019 wewin. All rights reserved.
//

#import "TemplateUtils.h"
#import <WewinPrintExtApi/WewinPrintExtApi.h>

#define fontsize 2.5
#define xPoint 16.9

@implementation TemplateUtils

/**
 * 用户自己绘图,进行打印内容初始化
 *
 * @return NSArray
 */
+(NSArray *)initBitmaps{
    
    NSMutableArray *imageList = [NSMutableArray array];
    
    return imageList;
}

+(NSArray *)initLabels:(NSString *)xml{
    
    if(!xml){
        
        [[WwToast makeText:@"xml为空"] show];
        return nil;
    }
    
    return nil;
}


/**
 * 创建Label对象数组，进行打印内容初始化(所有位置，大小均是毫米为单位)
 *
 * @return NSArray
 */
+(NSArray *)initLabels {
    
    NSMutableArray *labels = [NSMutableArray array];
    
    //示意创建三张标签
    for(int i=0; i<1; i ++){
        // 单张标签初始化
        Label *label = [[Label alloc] init];
        label.labelWidth = 50;
        label.labelHeight = 35;
        //label.previewGraphicName = @"(30-45)";
        //        label.oritention = wwOritention0;
        //label.isBackground = YES;
        label.rfid = @"432";
        label.rfidStorageType = RFIDStorageTypeUIIOrESP;
        label.rfidCharStorageType = RfidCharStorageTypeDouble;
        
        // 文本
        TextBlock *txtBlock = [[TextBlock alloc] init];
        txtBlock.x = 2;
        txtBlock.y = 2;
        txtBlock.content = @"站名:白石头";
        txtBlock.maxW = 45;
        txtBlock.maxH = 30;
        txtBlock.lineOffset = 2.1;
        txtBlock.fontSize = 3.5;
        
        
        TextBlock *txtPositionBlock = [[TextBlock alloc] init];
        txtPositionBlock.x = 25;
        txtPositionBlock.y = 2;
        txtPositionBlock.content = @"位置:S-B";
        txtPositionBlock.maxW = 45;
        txtPositionBlock.maxH = 30;
        txtPositionBlock.lineOffset = 2.1;
        txtPositionBlock.fontSize = 3.5;
        
        
        TextBlock *txtXinghaoBlock = [[TextBlock alloc] init];
        txtXinghaoBlock.x = 2;
        txtXinghaoBlock.y = 8;
        txtXinghaoBlock.content = @"型号:           FDZ";
        txtXinghaoBlock.maxW = 45;
        txtXinghaoBlock.maxH = 30;
        txtXinghaoBlock.lineOffset = 2.1;
        txtXinghaoBlock.fontSize = 3.5;
        //    txtBlock.horizontalAlignment = wwHorizontalRight;
        //    txtBlock.oritention = wwOritention0;
        //    txtBlock.textType = wwTextTypeBoldAndItalics;
        
        TextBlock *txtOutDateBlock = [[TextBlock alloc] init];
        txtOutDateBlock.x = 2;
        txtOutDateBlock.y = 14;
        txtOutDateBlock.content = @"出期:2018-04";
        txtOutDateBlock.maxW = 45;
        txtOutDateBlock.maxH = 30;
        txtOutDateBlock.lineOffset = 2.1;
        txtOutDateBlock.fontSize = 3.5;
        
        
        TextBlock *txtToDateBlock = [[TextBlock alloc] init];
        txtToDateBlock.x = 25;
        txtToDateBlock.y = 14;
        txtToDateBlock.content = @"到期:2033-04";
        txtToDateBlock.maxW = 45;
        txtToDateBlock.maxH = 30;
        txtToDateBlock.lineOffset = 2.1;
        txtToDateBlock.fontSize = 3.5;
        
        // 二维码
        QrcodeBlock *qrcodeBlock = [[QrcodeBlock alloc]init];
        qrcodeBlock.x = 1;
        qrcodeBlock.y = 2;
        qrcodeBlock.content = @"ssid1=CMCC-xxx(无线网络名称)&wifipwd=xxx(无线网络密钥)&username=xxx（终端配置帐号）&userpwd=xxx(终端配置密码)&model=xxx(类型)&sn=xxx(PON SN)& &ip=192.168.1.1&vendor=xxx(厂商名称英文简称)&productname=xxx(具体型号)&date=xxx(生产日期)";
        qrcodeBlock.width = 17.1;
        //    qrcodeBlock.oritention = wwOritention90;
        //    qrcodeBlock.qrCodeCorrectionLeve = wwQrCodeCorrectionLevelL;
        
        
        // 条码
        BarcodeBlock *barcodeBlock = [[BarcodeBlock alloc] init];
        barcodeBlock.x = 5;
        barcodeBlock.y = 20;
        barcodeBlock.content = @"1234567890ssss";
        barcodeBlock.width = 40;
        barcodeBlock.height = 10;
        //barcodeBlock.oritention = wwOritention90;
        //barcodeBlock. = wwQrCodeCorrectionLevelL;
        
        ///条码下面的字体
        
        TextBlock *txtCodeBlock = [[TextBlock alloc] init];
        txtCodeBlock.x = 18;
        txtCodeBlock.y = 30;
        txtCodeBlock.content = @"1890099";
        txtCodeBlock.maxW = 45;
        txtCodeBlock.maxH = 20;
        txtCodeBlock.lineOffset = 2.1;
        txtCodeBlock.fontSize = 3.5;
        
        
        // 图片
        // UIImage *image = [UIImage imageNamed:@"(30-45)"];
        GraphicBlock *graphicBlock = [[GraphicBlock alloc] init];
        graphicBlock.x = 0;
        graphicBlock.y = 0;
        graphicBlock.width = 45;
        graphicBlock.height = 30;
        graphicBlock.graphic = @"(30-45)";
        graphicBlock.oritention = wwOritention90;
        
        // 线条  框  上部线条
        LineBlock *lineBlock = [[LineBlock alloc] init];
        lineBlock.x = 0;
        lineBlock.y = 0;
        lineBlock.width = 50;
        lineBlock.height = 0.2;
        lineBlock.oritention = wwOritention0;
        
        // 线条  框  上部线条
        LineBlock *FirstlineBlock = [[LineBlock alloc] init];
        FirstlineBlock.x = 0;
        FirstlineBlock.y = 7;
        FirstlineBlock.width = 50;
        FirstlineBlock.height = 0.2;
        FirstlineBlock.oritention = wwOritention0;
        
        
        // 线条  框  上部线条
        LineBlock *secondlineBlock = [[LineBlock alloc] init];
        secondlineBlock.x = 0;
        secondlineBlock.y = 13;
        secondlineBlock.width = 50;
        secondlineBlock.height = 0.2;
        secondlineBlock.oritention = wwOritention0;
        
        // 线条  框  左侧部线条
        LineBlock *lineVerticalBlock = [[LineBlock alloc] init];
        lineVerticalBlock.x = 0;
        lineVerticalBlock.y = 0;
        lineVerticalBlock.width = 0.2;
        lineVerticalBlock.height = 35;
        lineVerticalBlock.oritention = wwOritention0;
        
        
        // 线条  框  底部线条
        LineBlock *bottomLine = [[LineBlock alloc] init];
        bottomLine.x = 0;
        bottomLine.y = 34.8;
        bottomLine.width = 50;
        bottomLine.height = 0.2;
        bottomLine.oritention = wwOritention0;
        
        ///右侧线条
        LineBlock *rightLine = [[LineBlock alloc] init];
        rightLine.x = 49.8;
        rightLine.y = 0;
        rightLine.width = 0.2;
        rightLine.height = 35;
        rightLine.oritention = wwOritention0;
        
        
        // 矩形
        RectBlock *rectBlock = [[RectBlock alloc] init];
        rectBlock.x = 10;
        rectBlock.y = 27.5;
        rectBlock.thinkness = 1;
        rectBlock.width = 30;
        rectBlock.height = 15;
        
        // 追加到lable里面
        NSArray *blocks = @[txtBlock,FirstlineBlock,secondlineBlock,txtXinghaoBlock,txtOutDateBlock,txtToDateBlock,txtCodeBlock,lineVerticalBlock,bottomLine,rightLine,txtPositionBlock,barcodeBlock,lineBlock];
        
        label.blocks = blocks;
        
        [labels addObject:label];
    }
    
    return labels;
}


///继电器标签
+(NSArray *)initRelayLabels{
    
    NSMutableArray *labels = [NSMutableArray array];
    
    //示意创建三张标签
    for(int i=0; i<1; i ++){
        // 单张标签初始化
        Label *label = [[Label alloc] init];
        label.labelWidth = 40;
        label.labelHeight = 40;
        //label.previewGraphicName = @"(30-45)";
        //        label.oritention = wwOritention0;
        //label.isBackground = YES;
        //        label.rfid = @"432";
        //        label.rfidStorageType = RFIDStorageTypeUIIOrESP;
        //        label.rfidCharStorageType = RfidCharStorageTypeDouble;
        
        // 文本
        TextBlock *txtBlock = [[TextBlock alloc] init];
        txtBlock.x = 2;
        txtBlock.y = 1;
        txtBlock.content = @"站名:拉白";
        txtBlock.maxW = 45;
        txtBlock.maxH = 30;
        txtBlock.lineOffset = 2.1;
        txtBlock.fontSize = fontsize;
        
        
        TextBlock *txtPositionBlock = [[TextBlock alloc] init];
        txtPositionBlock.x = 2;
        txtPositionBlock.y = 5;
        txtPositionBlock.content = @"型号:HF1-25";
        txtPositionBlock.maxW = 45;
        txtPositionBlock.maxH = 30;
        txtPositionBlock.lineOffset = 2.1;
        txtPositionBlock.fontSize = fontsize;
        
        
        TextBlock *txtXinghaoBlock = [[TextBlock alloc] init];
        txtXinghaoBlock.x = 2;
        txtXinghaoBlock.y = 9;
        txtXinghaoBlock.content = @"位置:2-3-6-1";
        txtXinghaoBlock.maxW = 45;
        txtXinghaoBlock.maxH = 30;
        txtXinghaoBlock.lineOffset = 2.1;
        txtXinghaoBlock.fontSize = fontsize;
        //    txtBlock.horizontalAlignment = wwHorizontalRight;
        //    txtBlock.oritention = wwOritention0;
        //    txtBlock.textType = wwTextTypeBoldAndItalics;
        
        TextBlock *txtOutDateBlock = [[TextBlock alloc] init];
        txtOutDateBlock.x = 2;
        txtOutDateBlock.y = 13;
        txtOutDateBlock.content = @"出期:2018-04";
        txtOutDateBlock.maxW = 45;
        txtOutDateBlock.maxH = 30;
        txtOutDateBlock.lineOffset = 2.1;
        txtOutDateBlock.fontSize = fontsize;
        
        
        TextBlock *txtToDateBlock = [[TextBlock alloc] init];
        txtToDateBlock.x = 2;
        txtToDateBlock.y = 17;
        txtToDateBlock.content = @"到期:2033-04";
        txtToDateBlock.maxW = 45;
        txtToDateBlock.maxH = 30;
        txtToDateBlock.lineOffset = 2.1;
        txtToDateBlock.fontSize = fontsize;
        
        
        
        TextBlock *txtWayBlock = [[TextBlock alloc] init];
        txtWayBlock.x = 2;
        txtWayBlock.y = 21;
        txtWayBlock.content = @"方式:";
        txtWayBlock.maxW = 45;
        txtWayBlock.maxH = 30;
        txtWayBlock.lineOffset = 2.1;
        txtWayBlock.fontSize = fontsize;
        
        //        // 二维码
        //        QrcodeBlock *qrcodeBlock = [[QrcodeBlock alloc]init];
        //        qrcodeBlock.x = 1;
        //        qrcodeBlock.y = 2;
        //        qrcodeBlock.content = @"ssid1=CMCC-xxx(无线网络名称)&wifipwd=xxx(无线网络密钥)&username=xxx（终端配置帐号）&userpwd=xxx(终端配置密码)&model=xxx(类型)&sn=xxx(PON SN)& &ip=192.168.1.1&vendor=xxx(厂商名称英文简称)&productname=xxx(具体型号)&date=xxx(生产日期)";
        //        qrcodeBlock.width = 17.1;
        //    qrcodeBlock.oritention = wwOritention90;
        //    qrcodeBlock.qrCodeCorrectionLeve = wwQrCodeCorrectionLevelL;
        
        
        // 条码
        BarcodeBlock *barcodeBlock = [[BarcodeBlock alloc] init];
        barcodeBlock.x = 1;
        barcodeBlock.y = 26;
        barcodeBlock.content = @"1234567890ssss";
        barcodeBlock.width = 38;
        barcodeBlock.height = 10;
        //barcodeBlock.oritention = wwOritention90;
        //barcodeBlock. = wwQrCodeCorrectionLevelL;
        
        ///条码下面的字体
        
        TextBlock *txtCodeBlock = [[TextBlock alloc] init];
        txtCodeBlock.x = 17;
        txtCodeBlock.y = 36;
        txtCodeBlock.content = @"0019";
        txtCodeBlock.maxW = 45;
        txtCodeBlock.maxH = 8;
        txtCodeBlock.lineOffset = 2.1;
        txtCodeBlock.fontSize = fontsize;
        
        
        // 图片
        // UIImage *image = [UIImage imageNamed:@"(30-45)"];
        //        GraphicBlock *graphicBlock = [[GraphicBlock alloc] init];
        //        graphicBlock.x = 0;
        //        graphicBlock.y = 0;
        //        graphicBlock.width = 45;
        //        graphicBlock.height = 30;
        //        graphicBlock.graphic = @"(30-45)";
        //        graphicBlock.oritention = wwOritention90;
        
        // 线条  框  上部线条
        LineBlock *lineBlock = [[LineBlock alloc] init];
        lineBlock.x = 0;
        lineBlock.y = 0;
        lineBlock.width = 50;
        lineBlock.height = 0.2;
        lineBlock.oritention = wwOritention0;
        
        // 线条  中间横线
        LineBlock *FirstlineBlock = [[LineBlock alloc] init];
        FirstlineBlock.x = 0;
        FirstlineBlock.y = 4.5;
        FirstlineBlock.width = 50;
        FirstlineBlock.height = 0.2;
        FirstlineBlock.oritention = wwOritention0;
        
        
        // 线条  框  中间横线
        LineBlock *secondlineBlock = [[LineBlock alloc] init];
        secondlineBlock.x = 0;
        secondlineBlock.y = 8.5;
        secondlineBlock.width = 50;
        secondlineBlock.height = 0.2;
        secondlineBlock.oritention = wwOritention0;
        
        
        // 线条  框  中间横线
        LineBlock *thirdlineBlock = [[LineBlock alloc] init];
        thirdlineBlock.x = 0;
        thirdlineBlock.y = 12.5;
        thirdlineBlock.width = 50;
        thirdlineBlock.height = 0.2;
        thirdlineBlock.oritention = wwOritention0;
        
        // 线条  框  中间横线
        LineBlock *fourthlineBlock = [[LineBlock alloc] init];
        fourthlineBlock.x = 0;
        fourthlineBlock.y = 16.5;
        fourthlineBlock.width = 50;
        fourthlineBlock.height = 0.2;
        fourthlineBlock.oritention = wwOritention0;
        
        // 线条  框  中间横线
        LineBlock *fifthlineBlock = [[LineBlock alloc] init];
        fifthlineBlock.x = 0;
        fifthlineBlock.y = 20.5;
        fifthlineBlock.width = 50;
        fifthlineBlock.height = 0.2;
        fifthlineBlock.oritention = wwOritention0;
        
        // 线条  框  中间横线
        LineBlock *sixlineBlock = [[LineBlock alloc] init];
        sixlineBlock.x = 0;
        sixlineBlock.y = 24.5;
        sixlineBlock.width = 50;
        sixlineBlock.height = 0.2;
        sixlineBlock.oritention = wwOritention0;
        
        
        // 线条  框  左侧部线条
        LineBlock *lineVerticalBlock = [[LineBlock alloc] init];
        lineVerticalBlock.x = 0;
        lineVerticalBlock.y = 0;
        lineVerticalBlock.width = 0.2;
        lineVerticalBlock.height = 50;
        lineVerticalBlock.oritention = wwOritention0;
        
        
        // 线条  框  底部线条
        LineBlock *bottomLine = [[LineBlock alloc] init];
        bottomLine.x = 0;
        bottomLine.y = 39.8;
        bottomLine.width = 40;
        bottomLine.height = 0.2;
        bottomLine.oritention = wwOritention0;
        
        ///右侧线条
        LineBlock *rightLine = [[LineBlock alloc] init];
        rightLine.x = 39.8;
        rightLine.y = 0;
        rightLine.width = 0.2;
        rightLine.height = 40;
        rightLine.oritention = wwOritention0;
        
        
        // 矩形
        RectBlock *rectBlock = [[RectBlock alloc] init];
        rectBlock.x = 10;
        rectBlock.y = 27.5;
        rectBlock.thinkness = 1;
        rectBlock.width = 30;
        rectBlock.height = 15;
        
        // 追加到lable里面
        NSArray *blocks = @[txtBlock,txtWayBlock,FirstlineBlock,secondlineBlock,thirdlineBlock,fourthlineBlock,fifthlineBlock,sixlineBlock,txtXinghaoBlock,txtOutDateBlock,txtToDateBlock,txtCodeBlock,lineVerticalBlock,bottomLine,rightLine,txtPositionBlock,barcodeBlock,lineBlock];
        
        label.blocks = blocks;
        
        [labels addObject:label];
    }
    
    return labels;
}

///转辙机标签
+(NSArray *)initSwitchLabels{
    
    NSMutableArray *labels = [NSMutableArray array];
    
    //示意创建三张标签
    for(int i=0; i<1; i ++){
        
        // 单张标签初始化
        Label *label = [[Label alloc] init];
        
        label.labelWidth = 40;
        label.labelHeight = 24;
        
        //label.previewGraphicName = @"(30-45)";
        //        label.oritention = wwOritention0;
        //label.isBackground = YES;
        //        label.rfid = @"432";
        //        label.rfidStorageType = RFIDStorageTypeUIIOrESP;
        //        label.rfidCharStorageType = RfidCharStorageTypeDouble;
        
        
        // 检测合格证
        
        TextBlock *txtBlock = [[TextBlock alloc] init];
        txtBlock.x = 2;
        txtBlock.y = 1;
        txtBlock.content = @"检测合格证";
        txtBlock.maxW = 45;
        txtBlock.maxH = 30;
        txtBlock.lineOffset = 2.1;
        txtBlock.fontSize = fontsize;
        
        
        TextBlock *txtPositionBlock = [[TextBlock alloc] init];
        txtPositionBlock.x = 17;
        txtPositionBlock.y = 1;
        txtPositionBlock.content = @"型号:HF1-25";
        txtPositionBlock.maxW = 45;
        txtPositionBlock.maxH = 30;
        txtPositionBlock.lineOffset = 2.1;
        txtPositionBlock.fontSize = fontsize;
        
        
        TextBlock *txtXinghaoBlock = [[TextBlock alloc] init];
        txtXinghaoBlock.x = 17;
        txtXinghaoBlock.y = 5;
        txtXinghaoBlock.content = @"编号:2-3-6-1";
        txtXinghaoBlock.maxW = 45;
        txtXinghaoBlock.maxH = 30;
        txtXinghaoBlock.lineOffset = 2.1;
        txtXinghaoBlock.fontSize = fontsize;
        //    txtBlock.horizontalAlignment = wwHorizontalRight;
        //    txtBlock.oritention = wwOritention0;
        //    txtBlock.textType = wwTextTypeBoldAndItalics;
        
        TextBlock *txtOutDateBlock = [[TextBlock alloc] init];
        txtOutDateBlock.x = 17;
        txtOutDateBlock.y = 9;
        txtOutDateBlock.content = @"检修:张三";
        txtOutDateBlock.maxW = 45;
        txtOutDateBlock.maxH = 30;
        txtOutDateBlock.lineOffset = 2.1;
        txtOutDateBlock.fontSize = fontsize;
        
        
        TextBlock *txtToDateBlock = [[TextBlock alloc] init];
        txtToDateBlock.x = 17;
        txtToDateBlock.y = 13;
        txtToDateBlock.content = @"验收:李四";
        txtToDateBlock.maxW = 45;
        txtToDateBlock.maxH = 30;
        txtToDateBlock.lineOffset = 2.1;
        txtToDateBlock.fontSize = fontsize;
        
        
        
        TextBlock *txtWayBlock = [[TextBlock alloc] init];
        txtWayBlock.x = 17;
        txtWayBlock.y = 17;
        txtWayBlock.content = @"检修时间:2018/10/9";
        txtWayBlock.maxW = 45;
        txtWayBlock.maxH = 30;
        txtWayBlock.lineOffset = 2.1;
        txtWayBlock.fontSize = fontsize;
        
        //        // 二维码
        QrcodeBlock *qrcodeBlock = [[QrcodeBlock alloc]init];
        qrcodeBlock.x = 0.8;
        qrcodeBlock.y = 5;
        qrcodeBlock.content = @"ssid1=CMCC-xxx(无线网络名称)&wifipwd=xxx(无线网络密钥)&username=xxx（终端配置帐号）&userpwd=xxx(终端配置密码)&model=xxx(类型)&sn=xxx(PON SN)& &ip=192.168.1.1&vendor=xxx(厂商名称英文简称)&productname=xxx(具体型号)&date=xxx(生产日期)";
        qrcodeBlock.width = 15.5;
        qrcodeBlock.oritention = wwOritention90;
        qrcodeBlock.qrCodeCorrectionLeve = wwQrCodeCorrectionLevelL;
        
        
        // 条码
        BarcodeBlock *barcodeBlock = [[BarcodeBlock alloc] init];
        barcodeBlock.x = 1;
        barcodeBlock.y = 26;
        barcodeBlock.content = @"1234567890ssss";
        barcodeBlock.width = 38;
        barcodeBlock.height = 10;
        //barcodeBlock.oritention = wwOritention90;
        //barcodeBlock. = wwQrCodeCorrectionLevelL;
        
        ///条码下面的字体
        
        TextBlock *txtCodeBlock = [[TextBlock alloc] init];
        txtCodeBlock.x = 17;
        txtCodeBlock.y = 36;
        txtCodeBlock.content = @"0019";
        txtCodeBlock.maxW = 45;
        txtCodeBlock.maxH = 8;
        txtCodeBlock.lineOffset = 2.1;
        txtCodeBlock.fontSize = fontsize;
        
        
        // 图片
        // UIImage *image = [UIImage imageNamed:@"(30-45)"];
        //        GraphicBlock *graphicBlock = [[GraphicBlock alloc] init];
        //        graphicBlock.x = 0;
        //        graphicBlock.y = 0;
        //        graphicBlock.width = 45;
        //        graphicBlock.height = 30;
        //        graphicBlock.graphic = @"(30-45)";
        //        graphicBlock.oritention = wwOritention90;
        
        // 线条  框  上部线条
        LineBlock *lineBlock = [[LineBlock alloc] init];
        lineBlock.x = 0;
        lineBlock.y = 0;
        lineBlock.width = 50;
        lineBlock.height = 0.2;
        lineBlock.oritention = wwOritention0;
        
        // 线条  中间横线
        LineBlock *FirstlineBlock = [[LineBlock alloc] init];
        FirstlineBlock.x = xPoint;
        FirstlineBlock.y = 4.5;
        FirstlineBlock.width = 50;
        FirstlineBlock.height = 0.2;
        FirstlineBlock.oritention = wwOritention0;
        
        
        // 线条  框  中间横线
        LineBlock *secondlineBlock = [[LineBlock alloc] init];
        secondlineBlock.x = xPoint;
        secondlineBlock.y = 8.5;
        secondlineBlock.width = 50;
        secondlineBlock.height = 0.2;
        secondlineBlock.oritention = wwOritention0;
        
        
        // 线条  框  中间横线
        LineBlock *thirdlineBlock = [[LineBlock alloc] init];
        thirdlineBlock.x = xPoint;
        thirdlineBlock.y = 12.5;
        thirdlineBlock.width = 50;
        thirdlineBlock.height = 0.2;
        thirdlineBlock.oritention = wwOritention0;
        
        // 线条  框  中间横线
        LineBlock *fourthlineBlock = [[LineBlock alloc] init];
        fourthlineBlock.x = xPoint;
        fourthlineBlock.y = 16.5;
        fourthlineBlock.width = 50;
        fourthlineBlock.height = 0.2;
        fourthlineBlock.oritention = wwOritention0;
        
        // 线条  框  中间横线
//        LineBlock *fifthlineBlock = [[LineBlock alloc] init];
//        fifthlineBlock.x = 0;
//        fifthlineBlock.y = 20.5;
//        fifthlineBlock.width = 50;
//        fifthlineBlock.height = 0.2;
//        fifthlineBlock.oritention = wwOritention0;
        
        // 线条  框  中间横线
//        LineBlock *sixlineBlock = [[LineBlock alloc] init];
//        sixlineBlock.x = 0;
//        sixlineBlock.y = 24.5;
//        sixlineBlock.width = 50;
//        sixlineBlock.height = 0.2;
//        sixlineBlock.oritention = wwOritention0;
        
        
        ///中间纵线
        LineBlock *MidVerticalBlock = [[LineBlock alloc] init];
        MidVerticalBlock.x = 16.8;
        MidVerticalBlock.y = 0;
        MidVerticalBlock.width = 0.1;
        MidVerticalBlock.height = 24;
        MidVerticalBlock.oritention = wwOritention0;
        
        // 线条  框  左侧部线条
        LineBlock *lineVerticalBlock = [[LineBlock alloc] init];
        lineVerticalBlock.x = 0;
        lineVerticalBlock.y = 0;
        lineVerticalBlock.width = 0.2;
        lineVerticalBlock.height = 50;
        lineVerticalBlock.oritention = wwOritention0;
        
        
        // 线条  框  底部线条
        LineBlock *bottomLine = [[LineBlock alloc] init];
        bottomLine.x = 0;
        bottomLine.y = 23.8;
        bottomLine.width = 40;
        bottomLine.height = 0.2;
        bottomLine.oritention = wwOritention0;
        
        ///右侧线条
        LineBlock *rightLine = [[LineBlock alloc] init];
        rightLine.x = 39.8;
        rightLine.y = 0;
        rightLine.width = 0.2;
        rightLine.height = 40;
        rightLine.oritention = wwOritention0;
        
        
        // 矩形
        RectBlock *rectBlock = [[RectBlock alloc] init];
        rectBlock.x = 10;
        rectBlock.y = 27.5;
        rectBlock.thinkness = 1;
        rectBlock.width = 30;
        rectBlock.height = 15;
        
        // 追加到lable里面
        NSArray *blocks = @[txtBlock,txtWayBlock,FirstlineBlock,secondlineBlock,thirdlineBlock,fourthlineBlock,MidVerticalBlock,txtXinghaoBlock,txtOutDateBlock,txtToDateBlock,txtCodeBlock,lineVerticalBlock,bottomLine,rightLine,txtPositionBlock,qrcodeBlock,lineBlock];
        
        label.blocks = blocks;
        
        [labels addObject:label];
    }
    
    return labels;
}

@end
